package com.nwpu.bigdata.controller;


import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;


import com.nwpu.bigdata.dto.Cassandra;
import com.nwpu.bigdata.dto.Iotdb;
import com.nwpu.bigdata.dto.Mysql;
import com.nwpu.bigdata.dto.Neo4j;
import com.nwpu.bigdata.service.CassandraService;
import com.nwpu.bigdata.service.IotdbService;
import com.nwpu.bigdata.service.MysqlService;
import com.nwpu.bigdata.service.Neo4jService;;




/**
 *@version:2018年4月26日下午5:04:01
*/
/**
 * @author Administrator
 *
 */
@Controller//标识他是一个控制器
@RequestMapping("/db")
public class DBTableController {
@Autowired
private CassandraService cassandraService;

	@RequestMapping(value="/cassandra", method={RequestMethod.GET}, produces="application/json;charset=UTF-8")
	public @ResponseBody List<Cassandra> queryRule(ModelAndView modelAndView) throws Exception {
	
		List<Cassandra> list = cassandraService.cassandraCol();
		return list;
	}
	
		@Autowired
		private Neo4jService neo4jService;

			@RequestMapping(value="/neo4j", method={RequestMethod.GET}, produces="application/json;charset=UTF-8")
			public @ResponseBody List<Neo4j> queryNeo4jTable(ModelAndView modelAndView) throws Exception {
			
				List<Neo4j> list = neo4jService.neo4jCol();
			
				return list;
			}
			@Autowired
			private MysqlService mysqlService;

				@RequestMapping(value="/mysql", method={RequestMethod.GET}, produces="application/json;charset=UTF-8")
				public @ResponseBody List<Mysql> queryMysqlTable(ModelAndView modelAndView) throws Exception {
				
					List<Mysql> list = mysqlService.mysqlCol();
					return list;
				}
				
				@Autowired
				private IotdbService iotdbService;

					@RequestMapping(value="/iotdb", method={RequestMethod.GET}, produces="application/json;charset=UTF-8")
					public @ResponseBody List<Iotdb> queryIotdbTable(ModelAndView modelAndView) throws Exception {
					System.out.println("WEWTET");
						List<Iotdb> list = iotdbService.iotdbCol();
						return list;
					}
	
}
